Edge enhancement correction for improved image quality

ABSTRACT

An objectionable outlining effect, seen as dark edges and white edges outlining everything in a scene, is eliminated by clipping or limiting the spikes generated by excessive enhancement. Specifically, a method is used for improving the quality of an enhanced video image, while simultaneously maintaining or improving image sharpness, by clipping the RGB levels of the enhanced video image, at the points of enhancement, to upper and lower level bounds representing the signal levels of the video signal prior to its enhancement.

BACKGROUND OF THE INVENTION

[0001] The detail in a color image represented by a video signal is visible because a relatively abrupt change of signal level occurs in one or more of its color components. This change of level is identified as an edge. A detail signal is generated whose level is a function of the rate of signal level change of the color components representing this edge. This detail (image enhancement) signal, when applied to the video signal from which it was generated, increases the abruptness or steepness of detail edges which enhances the visual sharpness of the video image. Image enhancement is generally applied to all areas of the image and is appropriate since it is a function of detail within the image. The enhancement process is described in numerous patents including U.S. Pat. Nos. 5,103,299 4,855,829, 5,696,852, and 4,994,915.

[0002] The detail signal in video cameras and scanners is adjustable. The greater the amplitude of the detail signal, the sharper the image. However, as the level of the detail signal is increased, a level is reached above which positive and negative spikes are generated that outline elements within the image and give the image a hard edged look. The detail level adjustment is a compromise between increased image sharpness, and image degradation from overly hard edges.

[0003] In image compositing, the subject is photographed against a colored backing, which is later replaced in the compositing process by the intended background. The bright color of the backing (typically blue or green) at the edge of the subject, often induces a large and inappropriate edge enhancement since the background to be inserted is not likely to be the bright color of the backing. This inappropriate image enhancement at the subjects edge causes a visible and objectionable hard edge outlining the subject in the composite image.

SUMMARY OF INVENTION

[0004] An objectionable outlining effect, seen as dark edges and white edges outlining everything in a scene, is eliminated by clipping or limiting the spikes generated by excessive enhancement. At any abrupt change of signal level, a step exists from a given level to a higher or lower level for one or more of the component colors. These two signal levels at the step establish lower level and upper level bounds. The spikes resulting from excessive enhancement extend below the lower level bound and above the upper level bound. It is the extension of the spikes below and above the unenhanced video signal that is clipped. These clips prevent the enhanced video signal from exceeding the upper level, or from going lower than the lower level. By clipping the enhancement spikes from the video signal, the objectionable outline and hard edges are eliminated while improving image quality and sharpness.

BRIEF DESCRIPTION OF THE DRAWINGS

[0005]FIG. 1 illustrates a change in video signal level of one of the image colors Red, Green, or Blue.

[0006]FIG. 2 illustrates the enhancement signal generated from the signal of FIG. 1.

[0007]FIG. 3 shows an enhanced (steeper) transition within the subject obtained by adding the enhancement signal of FIG. 2 to the video signal of FIG. 1.

[0008]FIG. 4 shows an excessive enhancement signal generated by excessive gain or by a large signal change that can occur at the transition from a subjects edge to a colored backing.

[0009]FIG. 5 illustrates the positive and negative spike (shaded areas) generated in the enhanced video signal due to an excessive enhancement signal.

[0010]FIG. 6 illustrates the enhanced video signal after the spikes are clipped.

[0011]FIG. 7 shows an overview of the edge enhancement correction process.

[0012]FIG. 8 details the process of performing the “multiple zero-crossings” check.

[0013]FIG. 9 details the process of performing the “distance from zero-matte boundary” check.

DETAILED DESCRIPTION OF THE INVENTION

[0014]FIG. 1 illustrates a moderately abrupt change in signal level occurring within the subject. The resulting enhancement signal of FIG. 2 when applied, at the proper level, to the video signal of FIG. 1, results in the enhanced (steeper edged) signal of FIG. 3. In an attempt to obtain maximum subjective image sharpness, the detail signal may be raised to a higher level as shown in FIG. 4. This excessively large detail signal, when applied to the video signal, generates the shaded spikes of FIG. 5. The adjustment of the enhancement signal level is therefore a compromise between a sharper image and an image not excessively degraded by hard edges.

[0015] The red (or green, or blue) signal level at a given pixel position is forced to lie between a lower bound and an upper bound, by “clipping” (lowering) the level to the upper bound if it is higher than that bound, or “clipping” (raising) the level to the lower bound if it is lower than that bound, as shown in FIG. 5, but otherwise, if the level lies between these two bounds it is left alone. The clipped signal of FIG. 6 is identical to the signal of FIG. 1, except for its steeper edge.

[0016] An additional increase in horizontal resolution may be achieved (steeper signal rise and fall) by first increasing the detail signal amplitude to an objectionable hard edged level, then removing the hard edge by clipping as described. An alternative procedure for increasing horizontal resolution is simply to treat the signal of FIG. 6 as an original signal, generate a detail signal, apply said detail signal, and clip if necessary.

[0017] The lower and upper clipping bounds are the RGB levels found at two different pixels, one lying at one or more pixels to one side of the given pixel, and the other lying at one or more pixels to the other side. E.g. one is to the left, and the other to the right, or one is above and the other is below the given pixel. Specifically, for clipping pixels in a horizontal line, the level at position x is clipped to be between the level at pixel position x−s and the level at pixel position x+s, for some small selected preset value of s, (e.g. 1, 2, 3, etc. pixels). The “clipping” is applied separately and independently to each of the three color component channels; red, green and blue.

[0018] When processing a line or sequence of pixels, starting at a designated pixel x, the pixel at position x−s will already have been processed (clipped). It is therefore necessary to retain the original level at x−s, (as well as the processed level) because the original level at x−s, not the processed level, is used when clipping the signal level at position x. The clipping function, as described, may be applied to the entire image or restricted to the subject's edge.

[0019] One of the hallmarks of film is its high definition without the hard edges so typical of television images. To preserve this film look, film scanners add very little enhancement to the scanned image. If the subject is against a colored backing, however, the bright backing will generate a hard edge with overshooting spikes as in FIG. 5, even though the detail signal for the rest of the image is not excessive. Therefore, clipping should be limited to the transition area between the subject and the backing.

[0020] The lower resolution of a television image requires significant enhancement to provide an optimally sharp image. The enhanced video will therefore contain small spikes at the edges of visible detail within the image. These small spikes become a necessary part of the image enhancement for best subjective image sharpness, and do not want to be clipped.

[0021] Restricting clipping to the subject's edge leaves the enhancement within the subject unaffected. However, restricting the clipping to the subjects edge requires knowledge as to the location of that edge. The subject edge is determined using the matte function Ec, which is zero in the opaque subject area, and larger than zero in the backing area. Two pixels are examined, one at position x−el, and the other at position x+el. The subject edge is found when only one of these two positions has a matte level of zero. This test may be defined as “condition 1” (which is based on the distance from the zero-matte boundary). If that condition is not met, then pixel x is not within el pixels of the subject edge, and clipping does not occur.

[0022] A second condition, “condition 2”, determines whether pixel x is near a “reasonably simple “subject edge, or a complex subject edge such as multiple strands of hair. When a matte signal Ec is available, this can be done by counting the number of times the matte signal Ec changes from zero to non-zero (a “zero-crossing”), i.e. counting the number of subject edges, as x moves along a line of pixels within some small adjustable window whose size is, 2gap+1, where “gap” is a user adjustable parameter. When a matte signal is not available, any means of detecting changes, such as a derivative signal, can be examined for multiple changes in the neighborhood of each pixel position x.

[0023] If the count of zero-crossings or multiple changes indicates a single edge, then the subject is simple and “condition 2” is said to be met. Otherwise, the subject is not “simple” and clipping is not performed, since clipping in such a region can create undesirable artifacts. Therefore, clipping is permitted only in the neighborhood of a simple subject edge, defined as meeting both condition 1 and condition 2.

[0024] Clipping the video signal at the subject's edge may be performed either before or after the subject is composited with a selected background scene.

[0025] After clipping the enhanced subject edge, (or the entire image), the clipped pixels may be smoothed by taking a weighted average of the current pixel and its two adjacent neighbors, one to the left and one to the right for horizontal smoothing, or one above and one below for vertical smoothing. Typically, the current pixel is given a weight of C=0.5, while the adjacent pixel on either side is given a weight of A=0.25, the three weights A+C+A summing to 1.0.

[0026] The edge of the subject was defined as that point at which the matte signal, Ec, is no longer zero. The matte signal, Ec, also called the alpha channel signal, or key signal, is determined by any equation that provides a zero in the subject area, and a signal larger than zero in the backing area. The following patents describe the development of the Ultimatte matte signal, which is generically in the form of:

Ec=B−max(G,R)

[0027] These patents are U.S. Pat. Nos. 4,100,569; 4,344,085; 4,625,231 and 5,343,252.

[0028] When a matte signal Ec of the type described above is not available, a derivative signal can be used, taking high derivative levels as indicating “subject” or more specifically “subject edge” regions. The “negative” of that signal, i.e. max {h−|derivative|, 0}, where h is the lowest derivative level which we consider as definitely indicating a subject edge, can then be used effectively as though it were a matte signal, at least for our edge enhancement correction purposes here. In this way, the rest of our discussion, making references to Ec, still applies.

[0029] When signal clipping is restricted to the subjects edge, a preferred clipping process includes the following steps:

[0030] 1. The clipping process is applied to all pixels on each horizontal scan line for which both said condition 1 and condition 2 are satisfied, using (for example), s=1, el=2, and gap=3.

[0031] 2. To the above result, clipping is again applied on each horizontal scan line for each pixel meeting condition 1 (ignoring condition 2), using s=1 and el=3. This second pass serves to “clean” some of the effects of the first pass, and to clip any pixels missed in the first pass.

[0032] 3. The above video signal having been horizontally clipped as in step 1 and 2 above, is vertically clipped using the levels at pixel position x in the previous raster line (L−1) and at pixel position x in the following raster line (L+1), as the upper and lower bounds for the current pixel x on the scan line lying between them, but only when only one of these two bound level pixels has a matte level of zero.

[0033] When processing an interlaced field rather than a consecutively scanned frame, the pixel at position x from the previous line (L−2) lies two pixels above the current pixel, and the pixel on the following line (L+2) is two pixels below the current pixel.

[0034] The smoothing described in steps 4 and 5 below are optional. They are applied when needed to clean up color fringing, and other edge artifacts. Weighting factors A and C need not be exactly 0.25 and 0.50, but these numbers have provided good results.

[0035] 4. The above video signals, having been horizontally clipped and vertically clipped, are then horizontally smoothed by applying the smoothing algorithm to all and only those pixels subjected to clipping using weighting factors of A=0.25 and C=0.50.

[0036] 5. To the horizontally smoothed video signal of step 4 above, vertical smoothing is applied to all and only those pixels subjected to clipping either horizontally or vertically, using weighting factors of A=0.25 and C=0.50.

[0037] If the entire enhanced image is to be clipped, the process becomes much simpler since there is no need to locate the subjects edge. Such an occasion arises when in a scanned film, the enhanced signal level, at the points of enhancement, does not exceed the unenhanced signal, as shown in FIG. 3. The spikes of FIG. 5 will still arise at the subjects edge because of the very high contrast between the brightly colored backing and the subject. Clipping the entire image will clip only those spikes extending above and below the level of the unenhanced signal.

[0038] A second occasion arises in a television video signal when the enhanced image includes small spikes overshooting the bounds defined by the unenhanced image, and where said small spikes provide optimal subjective image sharpness. However the large spikes of FIG. 5 will still be generated at the edge of the subject because of the very high contrast between the brightly colored backing and the subject. A small selected offset, equal to the height of the small spike overshoot, permits clipping the large spikes at the subjects edge without clipping the smaller spikes introduced by enhancement. A negative offset is added to the lower bound and a positive offset is added to the higher bound. These offsets need not be equal.

[0039] A preferred method for clipping and smoothing the entire image is as follows:

[0040] 1. On each horizontal scan line, RGB levels at pixel positions x−s, and x+s form an upper and lower bounds for the RGB levels at pixel position x, so that the RGB levels at pixel position x are each raised to the lower bound if below it, or lowered to the upper bound if above it.

[0041] 2. The above video signal, having been horizontally clipped, is vertically clipped using the RGB levels at pixel position x in the previous raster line and at pixel position x in the following raster line, as the upper and lower bounds for the current pixel on the scan line lying between them.

[0042] When processing an interlaced field rather than a consecutively scanned frame, the pixel at position x from the previous line lies two pixels above the current pixel, and the pixel on the following line is two pixels below the current pixel.

[0043] 3. The above video signal having been horizontally clipped and vertically clipped is then horizontally smoothed by applying the smoothing algorithm to all pixels which were candidates for clipping (e.g. which met conditions 1 and 2) using weighting factors of A=0.25 and C=0.50.

[0044] 4. To the horizontally smoothed video signal above, vertical smoothing is applied to all pixels which were candidates for clipping (e.g. which met conditions 1 and 2)—either horizontally or vertically, using weighting factors of A=0.25 and C=0.50.

[0045] Steps 3 and 4 are optional, and are applied when visual examination indicates the need for smoothing.

[0046] The clipping procedure described above is currently applied in post production to the already enhanced image. Since image enhancement is usually applied in the video camera, or in the film scanner when the original image was on film, an appropriate location for applying image clipping would be in the video camera, and in the film scanner.

[0047] When the unenhanced video signal is available, as is the case for video cameras and film scanners, the process of generating the detail signal also identifies its location on the scan line as well as the upper and lower signal level bounds, since these bounds are the signal level of the unenhanced video at or near those points. With bounds already determined, it is a simple matter to clip the enhanced video signal to the level of these bounds.

[0048] Many television receivers also apply a “sharpness control” to further apply image enhancement. Signal clipping in the television receiver, with a modest offset to preserve small spikes, would greatly improve image quality of receivers whose sharpness control is (often) over-adjusted.

Implementation of the Enhancement Correction Process

[0049] The following describes a detailed implementation of the enhancement correction process when the subject region has been previously determined in some way, such as by computing a matte signal from a picture of a subject in front of a uniform color backing, (e.g. a blue-screen).

[0050]FIG. 7 is a top level flow chart for edge enhancement correction.

[0051] Referring to FIG. 7, edge enhancement correction can proceed by first initializing (see block 1) a marker array, which stores a value for each pixel position x, by resetting this value to zero for each pixel position x.

[0052] Next, this marker array is updated by performing a “multiple zero-crossings” check (block 2), marking (setting the marker array value to 1 for) each pixel which is at the center of a multiple zero-crossings neighborhood—i.e. marking each pixel which does not meet condition 2.

[0053] Next, the marker array is updated by performing a “distance from zero-matte boundary” check (block 3), marking (setting the marker array value to 1 for) each pixel which is not near a simple edge of the zero-matte (opaque subject) region—i.e. marking each pixel which does not meet condition 1.

[0054] Next the basic clipping operation (block 4) is performed on each pixel which has not been marked—i.e. for which the marker array value is still zero.

[0055] Next, a smoothing operation (block 5) is performed for each pixel which has not been marked—i.e. for which the marker array value is still zero.

[0056] The final output (of block 5) is the edge-enhancement corrected image.

[0057]FIG. 8 details the process of performing the “multiple zero-crossings” check (block 2 in FIG. 7). The process illustrated in FIG. 8 is described as follows:

[0058] Initialize (block 6) some parameters: pixel position x to 1, a distance counter d to 0, and a zero-crossings counter ct to 0.

[0059] Next, reset a “condition counter” fl to 0 (block 7).

[0060] Next, check if the matte level at position x is positive (block 8). If it is, increment (add 1 to) the “condition counter” fl (block 9).

[0061] Next, check if the matte level at position x−1 is positive (block 10). If it is, increment the “condition counter” fl (block 11).

[0062] Next, check if the condition counter fl is equal to 1 (block 12). If it is, increment the “zero-crossings” counter ct (block 13), and set the distance counter d to fW (fW=2*gap+1, where gap is described earlier in the discussion ), a user supplied constant (see block 14).

[0063] Next, check if the distance counter d is positive (block 15). If it is, decrement (subtract 1 from) this distance counter (block 16). Otherwise (if it is not positive), reset the zero-crossings counter ct to zero (block 17).

[0064] Next, check if the zero-crossings counter is greater than 1 (block 18). If it is, mark pixel position x by setting the mark array to 1 at position x (block 19).

[0065] Next, check if there are any more pixels to process (block 20). If there are, increment pixel position x (block 21), go back to block 7, and repeat the process from that point.

[0066]FIG. 9 details the process of performing the “distance from zero-matte boundary” check (block 3 in FIG. 7). The process illustrated in FIG. 9 is described as follows:

[0067] Take the next pixel position—i.e. update pixel position parameter x (block 22): To clarify, if this is the first visit to this block, set x to zero. Otherwise, increment x.

[0068] Next, set “condition counter” fl to zero (block 23).

[0069] Next, check if the matte level at pixel position x−eW/2 is positive (block 24). eW, or “edgeWidth”, is a user supplied constant (eW=2*el, where el is referenced earlier in the discussion). If it is positive, increment the condition counter fl (block 25).

[0070] Next, check if the matte level at pixel position x+eW/2 is positive (block 26). If it is, increment fl (block 27).

[0071] Next, check if the condition counter fl is equal to 1 (block 28). If it is not equal to 1, mark pixel position x by setting the mark array to 1 at position x (block 29).

[0072] Next, check if there are any more pixels to process (block 30). If there are, go back to block 22, incrementing pixel position x, and repeat the process from that point. 

We claim:
 1. A method for improving the quality of an enhanced video image, while simultaneously maintaining or improving image sharpness, by clipping the RGB levels of said enhanced video image, at the points of enhancement, to upper and lower level bounds representing the signal levels of said video signal prior to its enhancement, where said method comprises the steps of; a) generating for each pixel on each horizontal scan line, said pixel located at position x, an upper bound and a lower bound for that pixel's signal levels using the RGB levels at x−s and at x+s, respectively, as those upper and lower bounds, where x is a pixel position on the scan line and s is a predetermined pixel position offset from position x. b) clipping the RGB levels of the pixel at x to the RGB levels of said lower bound when the RGB levels of the pixel at x are lower than said lower bound, c) clipping the RGB levels of the pixel at x to the RGB levels of said upper bound when the RGB levels of the pixel at x are greater than said upper bound.
 2. The method of claim 1 in which image quality is further improved by vertically clipping the RGB levels of said enhanced video image, at the points of enhancement, to upper and lower level bounds representing the unenhanced video signals, and further comprises the steps of, a) generating for each pixel on each clipped horizontal scan line a vertically aligned upper and lower bound for said pixel, using the RGB levels at the same horizontal position but on the preceding scan line (L−1) and the RGB levels at the same horizontal position but on the following scan line (L+1) to establish said bounds, b) clipping the RGB levels at said horizontal position x on scan line L to the RGB levels of the lower bounds when the RGB levels at x on line L are lower than said lower bounds, c) clipping the RGB levels at said horizontal position x on scan line L to the RGB levels of the uppers bound when the RGB levels at x on line L are greater than said upper bounds.
 3. The method of claim 1 in which the horizontally clipped scan lines are horizontally smoothed, and further comprises the steps of: a) assigning a weighting factor C to the signal levels at pixel position x and a weighting factor A to the signal levels at the adjacent pixels at x−1 and x+1, where A+C+A=1.0, b) horizontally smoothing all pixels on each scan line by replacing the RGB levels at position x with the weighted sum of the RGB levels at pixel positions x−1, x, and x+1.
 4. The method of claim 1 in which vertical columns of clipped pixels are vertically smoothed, and further comprises the steps of: a) assigning weighting factor C to the signal levels on the current scan line at horizontal pixel position x, and a weighting factor A to pixels at a corresponding horizontal position x on a preceding scan line (L−1), and a following scan line (L+1), where A+C+A=1.0, b) vertically smoothing all pixels in all columns of pixels by replacing the RGB levels at each pixel position x on each scan line L with the weighted sum of the RGB levels at pixel position x on scan line L, at pixel position x on line L−1, and at pixel position x on line L+1.
 5. The method of claim 3 in which weighting factor A is 0.25, and weighting factor C is 0.5.
 6. The method of claim 4 in which weighting factor A is 0.25, and weighting factor C is 0.5.
 7. A method of clipping enhancement spikes in a video image such as those at a subject's edge, without affecting smaller desirable enhancement spikes throughout the image, comprising the steps of: a) adding a negative offset to a lower level clipping bound; and b) adding a positive offset to an upper level clipping bound.
 8. A method for eliminating the visible outline at a subject's edge in an enhanced composite video image by clipping RGB levels of said enhanced video image to upper and lower level bounds represented by the signal levels of a video signal prior to its enhancement, and where said clipping is limited to a subject's edge, and comprises the steps of: a) generating matte signal Ec for each pixel, where Ec is zero in an opaque subject area, and greater than zero outside the opaque subject area, b) identifying subject's edges as those pixel positions x for which only one of the two pixels, one at x−el and the other at x+el, where el is a user defined integer, has a matte signal of zero, thus satisfying a first condition edge test, c) determining, for each subject edge, at pixel position x, that said subject edge is a simple edge, thus satisfying a second condition edge test, by counting the number of subject edges in its neighborhood, along a line of pixels within a window centered about x, whose width is 2gap+1 pixels, where gap is a user selectable number of pixels, and determining that this count does not exceed one, and p1 d) clipping RGB levels of each said simple subject edge pixel meeting said first condition and said second condition, to the bounds determined by the RGB levels of two pixels, one at position x−s, and the other at position x+s, where x is the position of the subject edge pixel, and s is a predetermined pixel position offset from position x.
 9. The method of claim 8 in which the constants used are: s=1, el=2, and gap=3
 10. The method of claim 8 in which the clipped signal is improved by clipping a second time using said first condition edge test and using s=1, and el=3. 